package com.example.resourceSharingPlatform.mappers;

import com.example.resourceSharingPlatform.entity.Account;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class AccountRowMapper implements RowMapper<Account> {
    @Override
    public Account mapRow(ResultSet rs, int i)throws SQLException{
        Account account = new Account();
        account.setId(rs.getString("user_id"));
        account.setBalance(rs.getDouble("balance"));
        account.setCredit(rs.getInt("credit"));
        return account;
    }
}
